package com.xk857.school.controller.pub;


import com.xk857.school.req.TourismREQ;
import com.xk857.school.service.ITourismService;
import com.xk857.util.base.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 组团旅游 前端控制器
 * </p>
 *
 * @author CV大魔王
 * @since 2021-05-02
 */
@Api(value = "组团旅游接口(公共)", tags = "组团旅游接口(公共)")
@RestController
@RequestMapping("/pub/tourism")
public class PubTourismController {

    @Autowired
    private ITourismService tourismService;

    @ApiOperation("条件查询组团列表接口")
    @PostMapping("/search")
    public Result searchListPub(@RequestBody TourismREQ req){
        return tourismService.searchListPub(req);
    }

    @ApiOperation("根据id查询组团信息")
    @GetMapping("/{id}")
    public Result searchById(@PathVariable String id){
        return tourismService.selectById(id);
    }

    @ApiOperation("浏览数加一")
    @PutMapping("/view/{id}")
    public Result viewAdd(@PathVariable String id){
        return tourismService.viewAdd(id);
    }

}
